
<div class="intro">
  <h3>People:  <%= if @users.size > 0
                    " #{User.count}  registered users"
                  else ""
                  end%>
  </h3>

</div>

<%= image_tag("icons/spinner.gif",
              :align => "absmiddle",
              :border => 0,
              :id => "spinner",
              :style =>"display: none;" ) %>
<div id="table">


  <% if @users.size == 0 %>
      <h3>No users found</h3>
  <% else %>
      <br />
      <b>Showing last   <%= @users.size %> active users</b>
      <!-- <b> users registered</b> -->
      <br/><br/>
      <table id="zebra-rows">
        <thead>
          <tr>
            <td width="150"><b>Profile</b></td>
            <td width="250"><b>Last exposure stream</b></td>
            <td width="170"><b>Annotations</b></td>
          </tr>
        </thead>
        <tbody>
          <% @users.each do |user|
          i=user[:user]
        %>
          <tr class="<%= cycle("even","odd") %>">

            <td>

                <a href="/users/<%=i.id %>"><img src="<%= i.image_url.thumb.to_s %>" width="50"/></a><b><br/><%= i.login %></b>
                <font style="font-size:11px"><br/><font style="color:#777777;">City:</font> <%= i.location %>
              <br/><font style="color:#777777;"> Measurements: </font><%= i.measures.count  %>
              <br/><font style="color:#777777;"> Annotations: </font><%= i.tags_size %>
              </font>
            </td>
            <td>

                  <%=  image_tag "/users/#{i.id}/tracks/last.png?size=200x100", :height=>100 %><br />
                  <% unless i.last_activity_at.nil? %>
                    <font style="font-size:11px">Updated <%=distance_of_time_in_words(i.try(:last_activity_at), Time.now) %> ago</font>
                  <% end %>
            </td>
            <td>
              <% unless user[:tags].empty?
                   tag_cloud(user[:tags], ["tag1","tag2","tag3","tag4"]) do |tag, css_class| %>
                      <%= link_to "#{tag.tag_name}", {:controller=>:tags, :action=>:filter, :tags => "tags:#{tag_tag.name}"}, :class => css_class %>,
                    <% end
              end %>
            </td>
          </tr>
          <% end %>
        </tbody>
      </table>
  <% end %>
</div>

<hr/>

<div>
<img src="/images/slide-real-time.jpg" width=100 />
<br/>
<%= #<a href="/users/realtime.kml">See collective exposure in realtime</a> (only public profiles)   <!-- too demanding -->
    %>
</div>